package com.ecommerce.dal.entity;
// Generated May 3, 2013 3:35:49 PM by Hibernate Tools 3.6.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * Admin generated by hbm2java
 */
@Entity
@PrimaryKeyJoinColumn(name="ADMIN_ID")
public class Admin extends User implements java.io.Serializable {

	private long adminId;
	private User user;

	public Admin() {
	}

	public Admin(User user) {
		this.user = user;
	}

//	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "user"))
//	@Id
//	@GeneratedValue(generator = "generator")
//	@Column(name = "ADMIN_ID", unique = true, nullable = false)
//	public long getAdminId() {
//		return this.adminId;
//	}
//
//	public void setAdminId(long adminId) {
//		this.adminId = adminId;
//	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

}
